﻿using System.ServiceModel.DomainServices.Client;
using System.Windows;
using System.Windows.Controls;
using MedLink2011.Views.ClinicCharts.ViewModels;
using MedLink2011.Web.Services;

namespace MedLink2011.Views.ClinicCharts.ChildWindows
{
    public partial class Evaluation_ExtremsAddCW : ChildWindow
    {
        
        readonly int loadedClinicChart_Id = MedLink2011.Views.Patients.ViewModels.ClinicChartViewModel.DashLoad_PK;
        //private int loadedPatient_Id = 1;
        
        public Evaluation_ExtremsAddCW()
        {
            InitializeComponent();
            
        }


        private void OKButton_Click(object sender, RoutedEventArgs e)
            {
                ClinicChart_IdTextBox.Text = loadedClinicChart_Id.ToString(); //make sure is not the primary key of the current form, it needs to be a FOREIGN key.
            if (!Evaluation_ExtremViewModel._evaluation_ExtremContext.IsLoading)
                {
                    this.Evaluation_ExtremsDataForm.CommitEdit();
                    this.DialogResult = true;
                }
            }
            
        private void CancelButton_Click(object sender, RoutedEventArgs e)
        {
            this.DialogResult = false;
        }
        



            private void Evaluation_ExtremsDataForm_EditEnded(object sender, DataFormEditEndedEventArgs e)
            {
                this.Close();
            }

    }
}

